package com.xltt.vehicleControl.bean;

import android.text.TextUtils;


import java.io.Serializable;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

public class Capability implements Serializable {


    private String vin;
    private int id;
    private String platform;
    private String modelCode;
    private String configCode;
    private String functionCategory;
    private String functionId;
    private boolean valueEnable;
    private String valueRange;
    private String valueEnum;
    private String name;
    private String tips;
    private Integer priority;
    private String showType;
    private String functionName;
    private static final boolean isCapabilityUsable = true;

    @Override
    public String toString() {
        return "Capability{" +
                "vin='" + vin + '\'' +
                ", id=" + id +
                ", platform='" + platform + '\'' +
                ", modelCode='" + modelCode + '\'' +
                ", configCode='" + configCode + '\'' +
                ", functionCategory='" + functionCategory + '\'' +
                ", functionId='" + functionId + '\'' +
                ", valueEnable=" + valueEnable +
                ", valueRange='" + valueRange + '\'' +
                ", valueEnum='" + valueEnum + '\'' +
                ", name='" + name + '\'' +
                ", tips='" + tips + '\'' +
                ", priority=" + priority +
                ", showType='" + showType + '\'' +
                ", functionName='" + functionName + '\'' +
                '}';
    }

    public String getVin() {
        return vin;
    }

    public void setVin(String vin) {
        this.vin = vin;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getPlatform() {
        return platform;
    }

    public void setPlatform(String platform) {
        this.platform = platform;
    }

    public String getModelCode() {
        return modelCode;
    }

    public void setModelCode(String modelCode) {
        this.modelCode = modelCode;
    }

    public String getConfigCode() {
        return configCode;
    }

    public void setConfigCode(String configCode) {
        this.configCode = configCode;
    }

    public String getFunctionCategory() {
        return functionCategory;
    }

    public void setFunctionCategory(String functionCategory) {
        this.functionCategory = functionCategory;
    }

    public String getFunctionId() {
        return functionId;
    }

    public void setFunctionId(String functionId) {
        this.functionId = functionId;
    }

    public boolean isValueEnable() {
        return valueEnable;
    }

    public void setValueEnable(boolean valueEnable) {
        this.valueEnable = valueEnable;
    }

    public String getValueRange() {
        return valueRange;
    }

    public void setValueRange(String valueRange) {
        this.valueRange = valueRange;
    }

    public String getValueEnum() {
        return valueEnum;
    }

    public void setValueEnum(String valueEnum) {
        this.valueEnum = valueEnum;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTips() {
        return tips;
    }

    public void setTips(String tips) {
        this.tips = tips;
    }

    public Integer getPriority() {
        return priority;
    }

    public void setPriority(Integer priority) {
        this.priority = priority;
    }

    public String getShowType() {
        return showType;
    }

    public void setShowType(String showType) {
        this.showType = showType;
    }

    public String getFunctionName() {
        return functionName;
    }

    public void setFunctionName(String functionName) {
        this.functionName = functionName;
    }

    public static boolean isIsCapabilityUsable() {
        return isCapabilityUsable;
    }

    public static boolean isFunctionEnable(List<Capability> capabilities, String functionId) {
        if (capabilities != null && capabilities.size() != 0) {
            Iterator var2 = capabilities.iterator();

            Capability capability;
            do {
                if (!var2.hasNext()) {
                    return false;
                }

                capability = (Capability) var2.next();
            } while (!functionId.equalsIgnoreCase(capability.getFunctionId()));

            return capability.isValueEnable();
        } else {
            return false;
        }
    }

    public static String[] getFunctionEnum(List<Capability> capabilities, String functionId) {
        if (capabilities != null && capabilities.size() != 0) {
            Iterator var2 = capabilities.iterator();

            Capability capability;
            do {
                if (!var2.hasNext()) {
                    return null;
                }

                capability = (Capability) var2.next();
            } while (!functionId.equalsIgnoreCase(capability.getFunctionId()));

            if (TextUtils.isEmpty(capability.getValueEnum())) {
                return null;
            } else {
                return capability.getValueEnum().split(",");
            }
        } else {
            return null;
        }
    }

	//v2版新添
    public static String[] getFunctionRange(List<Capability> capabilities, String functionId) {
        return getFunctionRange(capabilities, functionId, ",");
    }

	//v2版修改
    public static String[] getFunctionRange(List<Capability> capabilities, String
            functionId, String split) {
        if (capabilities != null && capabilities.size() != 0) {
            Iterator var2 = capabilities.iterator();

            Capability capability;
            do {
                if (!var2.hasNext()) {
                    return null;
                }

                capability = (Capability) var2.next();
            } while (!functionId.equalsIgnoreCase(capability.getFunctionId()));

            if (!checkString(capability.getValueRange())) {
                return null;
            } else {
                return capability.getValueRange().split(split);
            }
        } else {
            return null;
        }
    }
    public static boolean checkString(String string) {
        return string != null && string.length() > 0;
    }

    /**=================================仪表盘显示START============================================*/

    /**
     * 可续航里程
     *
     * @param capabilities
     * @return
     */
    public static boolean isMileageLifeEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "Mileage_life");
    }

    /**
     * 剩余油量
     *
     * @param capabilities
     * @return
     */
    public static boolean isFuelCapacityEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "fuel_capacity");
    }

    /**
     * 电量百分比能力集
     *
     * @param list
     * @return
     */
    public static boolean isShowElectricityErcentage(List<Capability> list) {
        return isFunctionEnable(list, "Electricity_ercentage");
    }

    /**
     * 总里程
     *
     * @param capabilities
     * @return
     */
    public static boolean isTotalMileageEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "total_mileage");
    }

    /**
     * 剩余保养里程
     *
     * @param list
     * @return
     */
    public static boolean isShowDistanceService(List<Capability> list) {
        return isFunctionEnable(list, "distance_Service");
    }

    /**
     * 平均百公里耗油（能耗）
     *
     * @param capabilities
     * @return
     */
    public static boolean isFuelConsumptionPerHundredKilometersEnabled(List<Capability>
                                                                               capabilities) {
        return isFunctionEnable(capabilities, "fuel_consumption_per_hundred_kilometers");
    }

    /**
     * 平均百公里电耗
     *
     * @param capabilities
     * @return
     */
    public static boolean isEneryConsumptionPerHundredKmEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "enery_consumption_per_hundred_km");
    }

    /**
     * 平均速度
     *
     * @param capabilities
     * @return
     */
    public static boolean isTheEverageSpeedEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "the_everage_speed");
    }

    /**
     * 驻车标志
     *
     * @param capabilities
     * @return
     */
    public static boolean isParkingFlagEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "parking_flag");
    }

    /**
     * 机油压力报警
     *
     * @param capabilities
     * @return
     */
    public static boolean isMotorOilAlarmEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "motor_oil_alarm");
    }
    /**==================================仪表盘显示END===========================================*/


    /**==================================车控指令START===========================================*/

    /**
     * 闪灯鸣笛
     *
     * @param capabilities
     * @return
     */
    public static boolean isHonkAndFlashEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "honk_flash");
    }

    /**
     * 开启后备箱
     *
     * @param capabilities
     * @return
     */
    public static boolean isRemoteTrunkOpenEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "remote_trunk_open");
    }

    /**
     * 关窗
     *
     * @param capabilities
     * @return
     */
    public static boolean isRemoteWindowCloseEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "remote_window_close");
    }

    /**
     * 开窗
     *
     * @param capabilities
     * @return
     */
    public static boolean isRemoteWindowOpenEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "remote_window_open");
    }

    /**
     * 一键透气
     *
     * @param capabilities
     * @return
     */
    public static boolean isRomoteWindowVentilateEnable(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "remote_window_ventilate");
    }

    /**
     * 空调（吉利车辆）
     *
     * @param capabilities
     * @return
     */
    public static boolean isRemoteAirConditionSwitchEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "remote_air_condition_switch");
    }

    /**
     * 空调（领克车辆）
     *
     * @param capabilities
     * @return
     */
    public static boolean isRemoteClimateControlEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "remote_climate_control");
    }

    /**
     * 座椅加热
     *
     * @param capabilities
     * @return
     */
    public static boolean isRemoteSeatPreheatSwitchEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "remote_seat_preheat_switch");
    }

    /**
     * 车内PM2.5净化
     *
     * @param capabilities
     * @return
     */
    public static boolean isRemoteOpenPM25PurificationEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "remote_open_PM2.5_purification");
    }

    /**
     * 车内空气净化
     *
     * @param capabilities
     * @return
     */
    public static boolean isRemoteOpenAirPurificationEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "remote_purification");
    }

    /**
     * 预约充电
     *
     * @param capabilities
     * @return
     */
    public static boolean isRemoteAppointmentChargingEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "remote_appointment_charging");
    }

    /**
     * 远程锁车
     *
     * @param capabilities
     * @return
     */
    public static boolean isRemoteCentraLockStatusEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "remote_centra_lockstatus");
    }

    /**
     * 启动引擎
     *
     * @param capabilities
     * @return
     */
    public static boolean isRemoteStartEngineEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "remote_start_engine");
    }

    /**
     * 后备箱解锁
     *
     * @param list
     * @return
     */
    public static boolean isShowRemoteTrunkUnlock(List<Capability> list) {
        return isFunctionEnable(list, "remote_trunk_unlock");
    }

    /**===================================车控指令END==========================================*/


    /**===================================车辆状态START==========================================*/

    /**
     * 车门状态
     *
     * @param capabilities
     * @return
     */
    public static boolean isVehiecleDoorsStatusEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "vehiecle_doors_status");
    }


    /**
     * 引擎盖状态
     *
     * @param capabilities
     * @return
     */
    public static boolean isEngineCompartmentCoverStatusEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "engine_compartment_cover_status");
    }

    /**
     * 后备箱状态
     *
     * @param capabilities
     * @return
     */
    public static boolean isTrunkStatusEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "trunk_status");
    }

    /**
     * 车锁状态
     *
     * @param capabilities
     * @return
     */
    public static boolean isDoorLockSwitchStatusEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "door_lock_switch_status");
    }

    /**
     * 车窗状态
     *
     * @param capabilities
     * @return
     */
    public static boolean isWindowsRollingStatusEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "windows_rolling_status");
    }

    /**
     * 天窗状态
     *
     * @param capabilities
     * @return
     */
    public static boolean isSkylightRollingStatusEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "skylight_rolling_status");
    }


    /**====================================车辆状态END=========================================*/


    /**====================================其他START=========================================*/

    /**
     * 扫码登录
     *
     * @param capabilities
     * @return
     */
    public static boolean isQrScanEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "qr_scan");
    }

    /**
     * pin码功能
     *
     * @param capabilities
     * @return
     */
    public static boolean isNeedPin(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "pin_switch");
    }

    /**
     * 发送到车
     *
     * @param list
     * @return
     */
    public static boolean isShowSendToCar(List<Capability> list) {
        return isFunctionEnable(list, "send_to_car_enable");
    }

    /**
     * 电子围栏
     *
     * @param capabilities
     * @return
     */
    public static boolean isGeographyFencingEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "geography_fencing");
    }


    /**
     * 接送好友
     *
     * @param capabilities
     * @return
     */
    public static boolean isPickupFriendsEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "pickup_friends");
    }

    /**
     * 车内温度
     *
     * @param list
     * @return
     */
    public static boolean isShowCarInternTemperature(List<Capability> list) {
        return isFunctionEnable(list, "ex_tempInCar");
    }

    /**
     * 车内PM2.5
     *
     * @param list
     * @return
     */
    public static boolean isShowInteriorPM25(List<Capability> list) {
        return isFunctionEnable(list, "interior_PM25");
    }

    /**
     * 车外PM2.5
     *
     * @param list
     * @return
     */
    public static boolean isShowExteriorPM25(List<Capability> list) {
        return isFunctionEnable(list, "exterior_PM25");
    }

    /**
     * 空气质量等级
     *
     * @param list
     * @return
     */
    public static boolean isShowAirQLevel(List<Capability> list) {
        return isFunctionEnable(list, "air_q_Level");
    }

    /**
     * 满油能力集
     *
     * @param list
     * @return
     */
    public static boolean isShowFuelTankCapacity(List<Capability> list) {
        return isFunctionEnable(list, "fuelTankCapacity");
    }

    /**
     * 控制页面车模图（SUV或者轿车）
     *
     * @param list
     * @return
     */
    public static String getControlCarModel(List<Capability> list) {
        return ConfigConstant.CAR_MODEL_SUV;
    }


    /**====================================其他END=========================================*/

    /**
     * 获取闪灯鸣笛的具体能力
     *
     * @param capabilities
     * @return
     */
    public static String[] getFindCarEnum(List<Capability> capabilities) {
        return getFunctionEnum(capabilities, "honk_flash");
    }

    /**
     * 获取具有开窗能力的位置
     *
     * @param capabilities
     * @return
     */
    public static String[] getWindowOpenEnum(List<Capability> capabilities) {
        return getFunctionEnum(capabilities, "remote_window_open");
    }

    /**
     * 获取具有关窗能力的位置
     *
     * @param capabilities
     * @return
     */
    public static String[] getWindowCloseEnum(List<Capability> capabilities) {
        return getFunctionEnum(capabilities, "remote_window_close");
    }

    /**
     * 获取具有座椅加热能力的位置
     *
     * @param capabilities
     * @return
     */
    public static String[] getSeatEnum(List<Capability> capabilities) {
        return getFunctionEnum(capabilities, "remote_seat_preheat_switch");
    }

    /**
     * 获取满油的值
     *
     * @param capabilities
     * @return
     */
    public static String[] getFuelTank(List<Capability> capabilities) {
        return getFunctionEnum(capabilities, "fuelTankCapacity");
    }

    /**
     * 获取座椅加热支持的等级
     *
     * @param capabilities
     * @return
     */
    public static List<String> getSeatHeatGradeEnum(List<Capability> capabilities) {
        if (capabilities != null && capabilities.size() != 0) {
            Iterator var2 = capabilities.iterator();

            Capability capability;
            do {
                if (!var2.hasNext()) {
                    return null;
                }

                capability = (Capability) var2.next();
            } while (!"remote_seat_preheat_switch".equalsIgnoreCase(capability.getFunctionId()));

            if (TextUtils.isEmpty(capability.getValueRange())) {
                return null;
            } else {
                return Arrays.asList(capability.getValueRange().split(","));
            }
        } else {
            return null;
        }
    }

    /**
     * 获取空调温度范围
     *
     * @param capabilities
     * @return
     */
    public static Map<String, String> getAirConditionTempRange(List<Capability> capabilities) {
		//NOTICE by shiwei v1，v2版合并修改
        String[] remote_air_condition_switches = getFunctionRange(capabilities, "remote_air_condition_switch","\\|");
        if (remote_air_condition_switches == null || remote_air_condition_switches.length != 2) {
            return null;
        } else {
            Map<String, String> map = new HashMap<String,String>();
            map.put("remote_air_condition_switches_0",remote_air_condition_switches[0]);
            map.put("remote_air_condition_switches_1",remote_air_condition_switches[1]);
            return map;
        }
    }


    /**
     * 车控指令是否需要先确认pin码
     *
     * @param capabilities
     * @param functionId
     * @return
     */
    public static boolean isNeedPin(List<Capability> capabilities, String functionId) {
        String[] functionEnum = getFunctionEnum(capabilities, "pin_switch");
        if (functionEnum == null) {
            return true;
        }
        for (String equals : functionEnum) {
            if (equals.equals(functionId)) {
                return false;
            }
        }
        return true;
    }


    public static boolean isDiagnosticsEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "remote_diagnostics_service");
    }

    public static boolean isRemoteWindowSwitchEnabled(List<Capability> capabilities) {
        return isRemoteWindowCloseEnabled(capabilities) || isRemoteWindowOpenEnabled(capabilities);
    }


    public static boolean isRemoteControlEnginerEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "remote-control-engine-start");
    }

    public static boolean isRemoteUseHighVoltageSwitchEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "remote_use_high_voltage_switch");
    }


    public static boolean isRemoteSeatVentilatingSwitchEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "remote_seat_ventilating_switch");
    }

    public static boolean isRemotePM25QueryEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "remote_PM2.5_query");
    }

    public static boolean isRemoteDashboardEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "remote_dashboard");
    }


    public static boolean isBatteryLifeEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "Battery_life");
    }


    public static boolean isTyrePressureEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "tyre_pressure");
    }


    public static boolean isVehiclePositionEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "vehicle_position");
    }

    public static boolean isVehicleStatusReportEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "vehicle_status_report");
    }


    public static boolean isPowerOfStorageBatteryEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "power_of_storage_battery");
    }


    public static boolean isGearsEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "gears");
    }

    public static boolean isChargingStatusEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "charging_status");
    }

    public static boolean isDrvingLogEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "drving_log");
    }

    public static boolean isDrivingTimeSingleTimeEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "driving_time_single_time");
    }

    public static boolean isTripMileageEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "trip_mileage");
    }

    public static boolean isFuelConsumptionSingleTimeEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "fuel_consumption__single_time");
    }

    public static boolean isAverageSpeedSingleTimeEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "average_speed_single_time");
    }

    public static boolean isBetteryConsumptionSingleTimeEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "bettery_consumption_single_time");
    }

    public static boolean isDrivingBehaviorEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "driving_behavior");
    }

    public static boolean isDataCollectionEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "data_collection");
    }

    public static boolean isAntiTheftEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "anti_theft");
    }

    public static boolean isTrailCarAlarmEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "trail_car_alarm");
    }


    public static boolean isStolenCarTrackEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "stolen_car_track");
    }

    public static boolean isSendToCarEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "send_to_car");
    }

    public static boolean isDesignatedDriverServiceEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "Designated_driver_service");
    }

    public static boolean isVehicleCleaningEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "vehicle_cleaning");
    }


    public static boolean isLastKilometerNavigationEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "last_kilometer_navigation");
    }

    public static boolean isOneClickNavigationEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "one_click_navigation");
    }

    public static boolean isOneClickNavigationNevEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "one_click_navigation_nev");
    }

    public static boolean isUserVehicleBindEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "user_vehicle_bind");
    }

    public static boolean isRemoteControlActivateSwitchEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "remote_control_activate_switch");
    }


    public static boolean isMaintainRemindEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "maintain_remind");
    }

    public static boolean isMaintainOrderEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "maintain_order");
    }

    public static boolean isParkingSeatEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "parking_seat");
    }

    public static boolean isFindChargingPileEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "find_charging_pile");
    }

    public static boolean isFinaCarNearlyEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "fina_car_nearly");
    }

    public static boolean isDoorLockSwitchControlEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "door_lock_switch_control");
    }

    public static boolean isRevokeUserSessionEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "revoke_user_session");
    }

    /**
     * 行车日志开关
     * @param capabilities
     * @return
     */
    public static boolean isJouSwitchEnabled(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "jou_switch");
    }


    /**
     * 智能预约充电
     * @param capabilities
     * @return
     */
    public static boolean isChargingLoop(List<Capability> capabilities){
        return isFunctionEnable(capabilities,"intelligent_appoint_charging");
    }

    /**
     * 是否开启 AB(驾驶位 和 副驾驶) 座椅加热
     * @param capabilities
     * @return
     */
    public static boolean isABHeating(List<Capability> capabilities){

        String[] strings = getFunctionEnum(capabilities,"intelligent_appoint_charging");

        if(strings != null && strings.length > 0){
            for (int i =0 ; i < strings.length ; i ++){
                if(strings[i] .equals("seat_heating")){
                    return true;
                }
            }
        }
        return false;
    }


    /**
     * 新的 预约充电 （ge13）
     * @param capabilities
     * @return
     */
    public static boolean isNewCharging(List<Capability> capabilities){

        String[] strings = getFunctionEnum(capabilities,"intelligent_appoint_charging");

        if(strings != null && strings.length > 0){
            for (int i =0 ; i < strings.length ; i ++){
                if(strings[i] .equals("appoint_charge")){
                    return true;
                }
            }
        }
        return false;
    }




    public interface ConfigConstant {

        String CAR_MODEL_DEFAULT = "1";//小车车型
        String CAR_MODEL_SUV = "2";//suv车型

    }

    public static boolean isBluetoothKeyEnable(List<Capability> capabilities) {
        return isFunctionEnable(capabilities, "bluetooth_key");
    }

    public static String getBluetoothKeyVersion(List<Capability> capabilities){
        return getShowType(capabilities,"bluetooth_key");
    }

    public static boolean isBluetoothDK10(List<Capability> capabilities){
        String bluetooth = getBluetoothKeyVersion(capabilities);
        return (bluetooth != null && bluetooth.equals("dk10"));
    }

    public static boolean isBluetoothDK15(List<Capability> capabilities){
        String bluetooth = getBluetoothKeyVersion(capabilities);
        return (bluetooth != null && bluetooth.equals("dk15"));
    }


    public static String getShowType(List<Capability> capabilities, String fuctionId) {
        if (capabilities != null && capabilities.size() != 0) {
            Iterator var2 = capabilities.iterator();

            Capability capability;
            do {
                if (!var2.hasNext()) {
                    return null;
                }

                capability = (Capability) var2.next();
            } while (!fuctionId.equalsIgnoreCase(capability.getFunctionId()));

            return capability.getShowType();
        }
        return null;
    }


}
